package project.service.impl;

import project.dao.UserDao;
import project.dao.impl.UserDaoImpl;
import project.entity.User;
import project.service.UserService;
import project.utils.DruidUtil;

/*
杨威
2021/9/11
17:34
*/
public class UserServiceImpl implements UserService {
    UserDao userDao=new UserDaoImpl();
    @Override
    public User login(String userName, String passWord) {
        User user = userDao.select(userName);
        if(user==null){
            DruidUtil.close();
            return null;
        }
        if(user.getPassWord().equals(passWord)){
            DruidUtil.close();
            return user;
        }
        DruidUtil.close();
        return null;
    }
}
